﻿using Admin2024.Application.Contracts.Permission.Dto;
using Admin2024.Application.Permission.Dto;
using Admin2024.Domain.Entity.System;
using Admin2024.Domain.ObjValue;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Admin2024.Application.Contracts.Permission
{
    public interface IPermissionService
    {
        /// <summary>
        /// 创建权限
        /// </summary>
        /// <param name="appPermission"></param>
        /// <returns></returns>
        Task<DomainResult<PermissionCreateSucessDto>> CreatePermission(PermissionCreateDto permissionCreateDto);

        /// <summary>
        /// 删除权限
        /// </summary>
        /// <param name="PerId"></param>
        /// <returns></returns>
        Task<DomainResult<AppPermission>> DeletePermission(Guid PerId);

        /// <summary>
        /// 创建资源权限
        /// </summary>
        /// <param name="appResource"></param>
        /// <returns></returns>
        Task<DomainResult<ResourceCreateSucessDto>> CreateResource(ResourceCreateDto resourceCreateDto);

        /// <summary>
        /// 删除资源权限
        /// </summary>
        /// <param name="resId"></param>
        /// <returns></returns>
        Task<DomainResult<AppResource>> DeleteResource(Guid resId);

        /// <summary>
        /// 创建操作权限
        /// </summary>
        /// <param name="appOperation"></param>
        /// <returns></returns>
        Task<DomainResult<OperationCreateSucessDto>> CreateOperation(OperationCreateDto operationCreateDto);

        /// <summary>
        /// 删除操作权限
        /// </summary>
        /// <param name="operId"></param>
        /// <returns></returns>
        Task<DomainResult<AppOperation>> DeleteOperation(Guid operId);

        //获取所有操作权限(分页)
        Task<DomainResult<List<OperationDto>>> GetOperationWithPagination(int page, int pageSize);

        //获取所有权限(分页)
        Task<DomainResult<List<PermissionDto>>> GetPermissionWithPagination(int page, int pageSize);

        //获取所有资源权限(分页)
        Task<DomainResult<List<ResourceDto>>> GetResourceWithPagination(int page, int pageSize);

        Task<DomainResult<ResourceDto>> GetAppResourceById(Guid id);

        Task<DomainResult<PermissionDto>> GetAppPermissionById(Guid id);

        Task<DomainResult<OperationDto>> GetOperationById(Guid id);

        Task<DomainResult<ResourceDto>> UpdateResourceProfile(Guid Id, ResourceUpdateDto entity);

        Task<DomainResult<OperationDto>> UpdateOperationProfile(Guid Id, OperationUpdateDto entity);
    }
}
